package zhh.tangbao.system.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * <p>
 *     描述
 * </p>
 * @author 粥灰灰
 * <p>2023/4/6</p>
 */

@Configuration
public class MvcConfig implements WebMvcConfigurer {

    @Value("${custom.fileUploadRule.imgACPath}")
    private String imgACPath;

    @Value("${custom.fileUploadRule.imgPCPath}")
    private String imgPCPath;

    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler(  imgACPath+ "/**").addResourceLocations("file:" + imgPCPath);
    }
}
